<script language="javascript" type="text/javascript">
    function killerrors() {
        return true;
    }
    window.onerror = killerrors;
</script>

<script language='javascript' type='text/javascript' src='/static/jquery.min.js'></script>
<script language='javascript' type='text/javascript' src='/static/jquery.url.js'></script>
<script type='text/javascript'>
    function loadHtmlEnd(pageSel,vvtoolPath,vvtoolPathValue) {

        $(pageSel).each(function (i) {
            var query = [];
            $.url.setUrl(window.location.href);
            var regionid = $.url.param('regionid');
            var deviceid = $.url.param('deviceid');
            var browserid = $.url.param('browserid');
            if(regionid!=undefined){
                query.push("regionid="+regionid);
            }
            if(deviceid!=undefined){
                query.push("deviceid="+deviceid);
            }
            if(browserid!=undefined){
                query.push("browserid="+browserid);
            }
            if(vvtoolPathValue!=undefined){
                query.push(vvtoolPath+"="+vvtoolPathValue);
            }
            var uurl = "";
            uurl = $.url.attr('protocol')+"://"+$.url.attr('host');
            if($.url.attr('port')!=null && $.url.attr('port')!=80){
                uurl = uurl+":"+ $.url.attr('port');
            }
            uurl = uurl+$.url.attr('path');

            $(this).attr('target', '_self');
            var href = $(this).attr('href');
            $.url.setUrl(href);
            bquery = $.url.attr('query');
            uurl = uurl+"?"+bquery+"&"+query.join("&");
            $(this).attr('href', uurl);
            $(this).attr("vv-data", "no-replace-href");
        });

        aaa();
    }

    function aaa() {
        var targetP;
        targetP = false;
//        if (searchindex.indexOf('www.baidu.com') < 0) {
//            targetP = true;
//        }
        $('a').each(function () {
            if ($(this).attr('vv-data') != 'no-replace-href') {
                $(this).click(function () {
                    var oldhref = $(this).attr('href');
                    $(this).attr('href_bak', oldhref);
                    $(this).attr('href', 'http://1.tztool.duapp.com/?url=' + encodeURIComponent(oldhref))
                });
                $(this).attr('target', "_blank");
                $(this).mouseover(function () {
                    mouseoverA(this);
                });
                $(this).mouseover(function () {
                    mouseoverA(this);
                });
            }
        })
    }
    function mouseoverA(obj) {
        if ($(obj).attr('href_bak') != '' && $(obj).attr('href_bak') != "undefined" && $(obj).attr('href_bak') != undefined) {
            obj.href = $(obj).attr('href_bak');
        }
    }

    function mouseoutA(obj) {
        mouseoverA(obj);
    }
</script>
